/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package proj5labbd.graphics.dependente;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.KeyEvent;
import proj5labbd.DBInterface;
import proj5labbd.graphics.MainFrame;
import proj5labbd.graphics.abstractOpGraphics.OperationFrame;

/*
 * Frame destinado à operações DML sobre dependente
 */
public class DepFrame extends OperationFrame {

    public final int width = 810;
    public final int height = 700;

    public DepFrame(MainFrame frame, DBInterface dbInterface) {
        super(frame);
        this.setTitle("Dependente");
        this.setDefaultCloseOperation(DepFrame.DISPOSE_ON_CLOSE);
        Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
        this.setBounds((dim.width - width)/2,(dim.height - height)/2,width,height);
        //adiciona painel
        addPanel(new DepInsertPanel(this, dbInterface),OpPanel.INSERT);
        addPanel(new DepViewPanel(this, dbInterface),OpPanel.VIEW);
        addPanel(new DepRmPanel(this, dbInterface),OpPanel.REMOVE);
        addPanel(new DepUpPanel(this, dbInterface),OpPanel.UPDATE);
        super.jtbbOperation.addTab("Inserção", null, insertPanel, "Inserção de dependentes");
        super.jtbbOperation.setMnemonicAt(0, KeyEvent.VK_1);
        super.jtbbOperation.addTab("Visualização", null, viewPanel, "Visualização de dependentes");
        super.jtbbOperation.setMnemonicAt(1, KeyEvent.VK_2);
        super.jtbbOperation.addTab("Remoção", null, rmPanel, "Remoção de dependentes");
        super.jtbbOperation.setMnemonicAt(1, KeyEvent.VK_2);
        super.jtbbOperation.addTab("Atualização", null, updatePanel, "Atualização de dependentes");
        super.jtbbOperation.setMnemonicAt(1, KeyEvent.VK_2);
    }

}
